home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 October
/
MACPOWER-1997-10.ISO.7z
/
MACPOWER-1997-10.ISO
/
AMUG
/
PROGRAMMING
/
Mac F2C 1.3.5.sit
/
Mac F2C 1.3.5
/
Mac F2C Libraries
/
libI77 Sources
/
access.c
next >
Wrap
Text File
|
1995-01-28
|
707b
|
47 lines
/*
This function returns 0 if file called fileName exists,
1 otherwise.
IMT 28 Nov 94
*/
#include <Files.h>
static StringPtr CopyCtoPstr( StringPtr pStr, char *cStr );
int access( char *fileName, int notUsed )
{
OSErr err;
short vRefNum;
FInfo info;
Str255 pFileName;
CopyCtoPstr( pFileName, fileName ); /* Make name a Pascal string */
err = GetFInfo( pFileName, 0, &info ); /* Check on the default volume */
if ( err )
return 1;
else
return 0;
}
static StringPtr CopyCtoPstr( StringPtr pStr, char *cStr )
{
short i;
char *p;
i = 0;
p = ((char *) pStr) + 1;
while ( *cStr && i < 255 )
{
*p++ = *cStr++;
i++;
}
*pStr = i;
return (StringPtr) pStr;
}